package gate_api

import (
	"base"
	"game_server/logic/gate/response"
	"game_server/model"
	"github.com/golang/protobuf/proto"
)

var (
	// 向网关服务器发起连接
	Dial func(agentId base.AgentId, address string)

	// 与网关服务器断开连接
	Close func(agentId base.AgentId)

	// 解析错误为可选参数
	ParseError func(err error) (options []gate_response.Option)

	// 发送数据
	// 会把data绑定到proto_server_gate.Request
	SendMsg func(player *model.Player, msg proto.Message, options ...gate_response.Option)

	// 写入数据
	// 将msg按照protobuf格式压缩并发送
	WriteMsg func(gateId base.AgentId, msg proto.Message)
)
